home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / text / SoundBox / bonus / dt_delmod.rexx next >
OS/2 REXX Batch file  |  1994-12-21  |  4KB  |  120 lines

  1. /*  DT-ARexx-Script
  2.     Kopieren, Entfernen eines Modules mit ninjiDT
  3.     $VER: dt_delmod.rexx 0.8 (16.11.94) ©1994 ninji :-)
  4.  */
  5.  
  6. options results
  7.  
  8. copy_dest_pt    = ""
  9. copy_dest_tfmx  = ""
  10. copy_dest_hip   = ""
  11. copy_dest_other = ""
  12. mode_xpk        = ""
  13. remark          = ""
  14.  
  15. pt_player       = "ProTracker NoiseTracker SoundTracker15"
  16. tfmx_player     = "TFMX TFMX_7V TFMX_Pro"
  17. hippel_player   = "Hippel Hippel-Coso"
  18.  
  19. reqtitle        = "delmodDT @ninji"
  20. file_prefs      = "S:ninjiDT.prefs"
  21. delete          = 1
  22. move            = 2
  23. disk            = 3
  24. error           = 0
  25.  
  26. /*  looking for some destinations */
  27. if exists(file_prefs) then do
  28.     call open(file, file_prefs, read)
  29.     do while ~eof(file)
  30.         string = readln(file)
  31.         select
  32.             when (word(string,1) == 'COPY_DEST_PT') then
  33.                 copy_dest_pt = substr(string,wordindex(string,2))
  34.             when (word(string,1) == 'COPY_DEST_TFMX') then
  35.                 copy_dest_tfmx = substr(string,wordindex(string,2))
  36.             when (word(string,1) == 'COPY_DEST_HIP') then
  37.                 copy_dest_hip = substr(string,wordindex(string,2))
  38.             when (word(string,1) == 'COPY_DEST_OTHER') then
  39.                 copy_dest_other = substr(string,wordindex(string,2))
  40.             when (word(string,1) == 'MODE_XPK') then do
  41.                 mode_xpk = word(string,2)
  42.                 remark = '0A'x || 'XPK-Mode:' mode_xpk
  43.                 end
  44.             otherwise
  45.             end
  46.         end
  47.     call close(file)
  48.     end
  49. if (copy_dest_other == "") then copy_dest_other = "RAM:"
  50.  
  51. address DELITRACKER
  52.  
  53. status m dir    ;mod_dir = result
  54. status m fil    ;mod_file = result
  55. status m num    ;mod_number = result
  56.  
  57. status m fmt    ;mod_fmt = result
  58.  
  59. select
  60.     when (pos(mod_fmt,pt_player) ~= 0) then dest = copy_dest_pt
  61.     when (pos(mod_fmt,tfmx_player) ~= 0) then dest = copy_dest_tfmx
  62.     when (pos(mod_fmt,hippel_player) ~= 0) then dest = copy_dest_hip
  63.     otherwise dest = copy_dest_other
  64.     end
  65. if (dest == "") then dest = "RAM:"
  66.  
  67. remark  = 'Typ:' mod_fmt || '0A'x || 'nach:' dest || remark
  68.  
  69. status m pnr    ;pnr_num = result
  70. 'status p' pnr_num 'sub'
  71. if (result = "yes") then remark = remark || '0A'x || "(Achtung! Subsongs möglich)"
  72.  
  73. /* RexxReqTools-Support */
  74. call addlib("rexxreqtools.library", 0, -30, 0)
  75. call rtezrequest( '"' mod_dir || mod_file || '"' || '0A'x || remark,,
  76.     "L_öschen|_Copy/Move|_DF0:|_Ach?!",,
  77.     reqtitle,,
  78.     "rt_idcmpflags=idcmp_diskinserted rtez_defaultresponse=2 rtez_flags=ezreqf_centertext",,
  79.     action)
  80.  
  81. /*  deleting or copying files */
  82. if (action ~= 0) then do
  83.     'clearlist ' mod_number
  84.     'playpause'
  85.     if (action ~= delete) then do
  86.         if (action == disk) then do
  87.             rtezrequest( "Bitte Diskette in DF0: einlegen",,
  88.                 ,reqtitle,,
  89.                 "rt_idcmpflags=idcmp_diskinserted")
  90.             dest = "DF0:"
  91.             end
  92.         address command
  93. /*  now's time to handle files */
  94.             say mode_xpk
  95.             if (mode_xpk ~= "") then 'xPack >NIL: "' || mod_dir || mod_file || '" METHOD' mode_xpk
  96.             else 'xPack >NIL: "' || mod_dir || mod_file || '"'
  97.             error = rc
  98.             if (~error) then do
  99.                 'copy >NIL: "' || mod_dir || mod_file ||,
  100.                 '" "' || dest || mod_file || '" noreq clone'
  101.                 error = rc
  102.             end
  103.         address
  104.         end
  105.     if (error ~= 0) then do
  106.         call rtezrequest( "Kopieren war nicht erfolgreich," || '0A'x ||,
  107.             "Modul aber aus Liste entfernt ...",,
  108.             "Hmmmm...",,
  109.             reqtitle)
  110.         end
  111.     else do
  112.         call rtezrequest('"' || mod_dir || mod_file || '" Löschen?',,
  113.             "Kl_ar doch!|_Ooops...",,
  114.             reqtitle,,
  115.             ,loesch)
  116.         if (loesch) then 
  117.             address command 'delete "' || mod_dir || mod_file || '"'
  118.         end
  119.     end
  120.